//
// Created by ta&to on 2022/9/28.
//

#ifndef HTTPSERVER_HTTP_CONNECT_H
#define HTTPSERVER_HTTP_CONNECT_H

#include "http_socket.h"
#include "http_io.h"

void conn_init(thread_pool_t *tpt, log_t *logt, http_socket_event_loop_t *hset, void* __socket_r_func, void* __socket_w_func);
void http_init(thread_pool_t *tpt, log_t *logt, http_socket_event_loop_t *hset);
void init_listen(struct http_socket_event_s *hset);
int get_client_fd(struct http_socket_event_s *hset, http_socket_event_handle_t *handler, int fd);
void unlock_client_fd(struct http_socket_event_s *hset, int fd);
void init_conn_fd(struct http_socket_event_s *hset);
struct http_server_http_connect_fd_s random_conn_fd(struct http_socket_event_s *hset);
struct http_server_http_connect_fd_s reset_conn_fd(struct http_socket_event_s *hset, int fd);
void unlock_conn_fd(struct http_socket_event_s *hset, int fd);
#endif //HTTPSERVER_HTTP_CONNECT_H
